<?php

class Manage_session extends CI_Model {

    function session($user_id, $identifier) {

        setcookie('LEAPSESSID', $user_id, time() + (20 * 365 * 24 * 60 * 60), '/');
        setcookie('LEAPSESSIF', $identifier, time() + (20 * 365 * 24 * 60 * 60), '/');
        $this->leapSession($user_id,$identifier);
    }
    function leapSession($user_id,$identifier){
        $this->load->library('session');
        $session = array(
            'user_id' => $user_id,
            'LEAP_'.$identifier.'_SESS' => true,
            'loggedIn' => true,
        );

        $this->session->set_userdata($session);
    }
}